﻿using Crowler.Dispatcher.DataContract;
using Crowler.Model.CoreComponents;
using Crowler.Model.Dispetcher.Api;

namespace Crowler.Dispatcher.Api
{

    public class DispatcherApi:IDispatcherApi
    {
        private readonly IAppEnvironment _appEnv;

        public DispatcherApi(IAppEnvironment appEnv)
        {
            _appEnv = appEnv;
        }

        public string GetEntryToDiscover(string request)
        {

            var serviceFacility =
                _appEnv.Resolve<IBusinessServiceFacility<string, string, FetchUndescoveredEntryServiceResponse, FetchUndescoveredEntryServiceResponse>>();
            serviceFacility.ServiceName = "BSDecorator";
            serviceFacility.Request = request;
            serviceFacility.Execute();
            return null;
        }


        public void DoSomething(string str)
        {
            //var bs = _appEnv.Resolve<IBusinessService<>>();
            //bs.Execute();
        }



    }
}
